<template>
	<view class="c-wrap">
		<view class="submitBar">
			<view class="submitBar-L">
				<u-checkbox v-model="allCheckFlag" shape="circle" @change="onAllCheckedChange">全选</u-checkbox>
			</view>
			<view class="submitBar-R">
				<g-btn title="删除"
					:customstyle="{width:'200rpx', height: '70rpx', background: '#FF4D4D !important', boxShadow: 'none'}"
					@click="onConfirmTap"></g-btn>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			amount: {
				type: [Number, String],
				default: 0
			}
		},
		data() {
			return {
				allCheckFlag: false
			}
		},
		onLoad(options) {

		},
		methods: {
			onSkipTap(type, index) {
				const urlObj = {
					shopCartSelect: () => {
						const page = getCurrentPages()
						const pageItem = page?.find(item => item.route ===
							'pages/commodityManagement/shopCartSelect')
						if (pageItem) return
						uni.navigateTo({
							url: '/pages/commodityManagement/shopCartSelect'
						})
					}
				}
				this.$g_util.navigationTo(urlObj, type)
			},
			onAllCheckedChange({
				value
			}) {
				this.$emit('change', value)
			},
			onConfirmTap() {
				this.$emit('confirm')
			}
		}
	}
</script>
<style>
	.u-checkbox {
		width: 150rpx;
	}
</style>
<style scoped lang="scss">
	.submitBar {
		position: fixed;
		left: 0;
		bottom: 0;
		width: 690rpx;
		height: 100rpx;
		background-color: #fff;
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 0 30rpx;
		padding-bottom: constant(safe-area-inset-bottom);
		padding-bottom: env(safe-area-inset-bottom);
		box-sizing: content-box;
		box-shadow: 0 0 10rpx 0rpx rgba(0, 0, 0, 0.1);
		z-index: 999;
	}

	.submitBar-L {
		display: flex;
		align-items: center;

		text {
			margin-left: 30rpx;
			font-size: 30rpx;
		}
	}

	.submitBar-LImg {
		position: relative;
		width: 38rpx;
		height: 38rpx;

		image {
			width: 38rpx;
			height: 38rpx;
		}
	}

	.submitBar-LCount {
		display: flex;
		align-items: center;
		justify-content: center;
		position: absolute;
		right: -10rpx;
		top: -10rpx;
		width: 30rpx;
		height: 30rpx;
		border-radius: 50%;
		background-color: #ff3333;
		color: #fff;
		font-size: 20rpx;
	}

	.submitBar-R {}
</style>
